<?php 
class Qusers extends E_Entity 
{
	public   $table =array(
					"id" =>"id",
					"version"=>"version",
					 "uid"=>"uid",                          
		             "name"=>"name",
					 "nick"=>"nick",
					 "birth_day"=>"birth_day",
					 "birth_month"=>"birth_month",
					 "birth_year"=>"birth_year",
					 "country_code"=>"country_code",
					 "province_code"=>"province_code",
					 "city_code"=>"city_code",
					 "location"=>"location",
					 "introduction"=>"introduction",
					 "verifyinfo"=>"verifyinfo",
					 "head"=>"head",
					 "sex"=>"sex",
					 "fansnum"=>"fansnum",
					 "idolnum"=>"idolnum",  
					 "isent"=>"isent",
					 "isvip"=>"isvip",
					 "tweetnum"=>"tweetnum",
					 "tag"=>"tag",
					"edu"=>"edu",
					 "token"=>"token",   
					 "token_secret"=>"token_secret",     
					"sign" =>"sign",
					"status" =>"status",
					"ctime" =>"ctime",
					"mtime" =>"mtime"
					);
	public function getTableName()
	{
		return "micro_quser";
	}
	public function getJoinMap()
	{
		$map = array("mapSite" =>array("Entity"=>"Sites","Method"=>"getByUserid", "param"=>"id"),
		
		);
		return $map;
	}
	public static function insertEntity($row)
	{	
		$entity = new self();
	 	return $entity->createEntityForRow($row);
	}
	public static function getById($id)
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} where  {$entity->table['id']} = :id";
		return $entity->getEntityByIndexKey($sql, $id, array("id"=>$id));
	}
	public static function getByUid($uid)
	{
		$entity = new self();
		$sql =  "select * from {$entity->getTableName()} where  {$entity->table['uid']} = :uid";
		return $entity->getEntityByIndexKey($sql, $id, array("uid"=>$uid));
	}
	
}
?>